<?php
	
?>

<div id="RibMenu">
	<!-- Load danh sách các RibbonLabel -->
	<div class="TabMenu">
		<div class="RibbonItem" id="Rib1"><a href="#">QL CHUNG</a></div>
		<div class="RibbonItem" id="Rib2"><a href="#">NHÂN SỰ</a></div>
		<div class="RibbonItem" id="Rib3"><a href="#">THU CHI</a></div>
		<div class="RibbonItem" id="Rib4"><a href="#">TKB - LỊCH HỌC</a></div>
		
		
		
		<div style="float:right; border-left:1px solid #DDD;" class="RibbonItem" id="Rib9"><a href="#"><img src="../data/menu_pin.png" /></a></div>
		<div class="RibbonItem" id="Rib8"><a href="#">CÁ NHÂN</a></div>
		<?php
			if(IsAD())
			{
				echo '<div style="float:right; background-color" class="RibbonItem" id="Rib7"><a href="#">QL NGƯỜI DÙNG</a></div>';
				echo '<div style="float:right" class="RibbonItem" id="Rib6"><a href="#">CÀI ĐẶT</a></div>';
			}
		?>
	</div>
</div>
<?php
	if(isset($_SESSION['tabLoad']))
		$load = $_SESSION['tabLoad'];
	else
		$load = 1;
	if(isset($_SESSION['allShow']))
		$allShow = $_SESSION['allShow'];
	else
		$allShow = 1;
?>
<div id="TestLoad" hidden="true">
	<!-- Kiểm tra Tab nào được chọn -->
</div>
<br />
<div id="RibOption">
	<!-- Load danh sách các Ribbon Menu -->
	<div id="ROp1" hidden="true"><?php include_once "../menu/qlchung.php"; ?></div>
	<div id="ROp2" hidden="true"><?php include_once "../menu/nhansu.php"; ?></div>
	<div id="ROp3" hidden="true"><?php include_once "../menu/thuchi.php"; ?></div>
	<div id="ROp4" hidden="true"><?php include_once "../menu/tkb_thoigian.php"; ?></div>
	
	<div id="ROp6" hidden="true"><?php include_once "../menu/caidat.php"; ?></div>
	<div id="ROp7" hidden="true"><?php include_once "../menu/qlnguoidung.php"; ?></div>
	<div id="ROp8" hidden="true"><?php include_once "../menu/canhan.php"; ?></div>
</div>

<style type="text/css">
	.CurrentMenu {
		background-color: #FFF;
		border-radius: 5px 5px 0 0;
		border: 1px solid #969696;
		border-bottom: 0;
	}
</style>

<script type="text/javascript">
	var load = <?php echo $load; ?>;
	var allShow  = <?php echo $allShow; ?>;
	
	$(document).ready(function() {
		$('#Rib1').addClass('CurrentMenu');
		if(allShow == 1)
			$('#RibOption').show();
		else
			$('#RibOption').hide();
		if(load == 1)
		{
			$('#ROp1').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib1').addClass('CurrentMenu');
		}
		else if(load == 2)
		{
			$('#ROp2').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib2').addClass('CurrentMenu');
		}
		else if(load == 3)
		{
			$('#ROp3').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib3').addClass('CurrentMenu');
		}
		else if(load == 4)
		{
			$('#ROp4').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib4').addClass('CurrentMenu');
		}
		else if(load == 5)
		{
			$('#ROp5').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib5').addClass('CurrentMenu');
		}
		else if(load == 6)
		{
			$('#ROp6').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib6').addClass('CurrentMenu');
		}
		else if(load == 7)
		{
			$('#ROp7').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib7').addClass('CurrentMenu');
		}
		else if(load == 8)
		{
			$('#ROp8').show();
			$('div[id^="Rib"]').removeClass('CurrentMenu');
			$('#Rib8').addClass('CurrentMenu');
		}
	});
	$('#Rib1').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp1').show();
		load = 1;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib2').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp2').show();
		load = 2;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib3').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp3').show();
		load = 3;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib4').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp4').show();
		load = 4;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib5').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp5').show();
		load = 5;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib6').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp6').show();
		load = 6;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib7').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp7').show();
		load = 7;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib8').click(function() {
		$('div[id^="Rib"]').removeClass('CurrentMenu');
		$(this).addClass('CurrentMenu');
		$('div[id^="ROp"]').hide();
		$('#ROp8').show();
		load = 8;
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "load=" + load,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
	$('#Rib9').click(function() {
		if(allShow == 1)
			allShow = 0;
		else
			allShow = 1;
		$('#RibOption').toggle();
		$.ajax({
			url: "../menu/menu_load.php",
			type: "post",
			data: "all=" + allShow,
			async: true,
			success: function(result){
				$('#TestLoad').html(result);
			}
		})
	});
</script>